# -*- coding: utf-8 -*-

import sys

from settings_common import *

###########################################################
#         For Developers / Testers :
# Set your own environment here.
#
###########################################################

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'panc',
        'USER': 'panc',
        'PASSWORD': 'panc.12345',
        'HOST': '',
        'PORT': '',
    }
}

INTERNAL_IPS = ["127.0.0.1"]
INTERNAL_IPS.extend(["192.168.1.%d" % ip for ip in range(41, 101)])
INTERNAL_IPS = tuple(INTERNAL_IPS)


def imported(module_name, version_key='__version__'):
    if module_name in sys.modules:
        if version_key:
            try:
                version = getattr(sys.modules[module_name], version_key)
                if callable(version):
                    version = version()

                return ' %s' % version
            except:
                return ''
        else:
            return ''
    else:
        return 'XXX'

try:
    import numpy
    import scipy
    import django
    import matplotlib
    from mpl_toolkits import basemap
except:
    pass

print '='*80
print 'numpy   %s' % imported('numpy')
print 'scipy   %s' % imported('scipy')
print 'django  %s' % imported('django', 'get_version')
print 'mpl     %s' % imported('matplotlib')
print 'basemap %s' % imported('mpl_toolkits.basemap')

from subprocess import call
call(["mysql", "-V"])
print '='*80
